package com.xiaomage.view.draw6

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.view.View

/**
 * Created by Administrator on 2018/1/2.
 */
class MyView(context: Context):View(context) {
    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)

        val paint= Paint()
        paint.style=Paint.Style.STROKE
        paint.isAntiAlias=true
        paint.color=Color.RED

        val path= Path()
        path.moveTo(100f,300f)
        path.quadTo(200f,200f,300f,300f)
        path.quadTo(400f,400f,500f,300f)

        canvas.drawPath(path,paint)
    }
}